package org.springblade.pm.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springblade.pm.config.DataSource;
import org.springblade.pm.entity.XmglProject;
import org.springblade.pm.entity.ZTProduct;
import org.springblade.pm.entity.ZTProject;
import org.springblade.pm.entity.ZTProjectproduct;
import org.springblade.pm.vo.PageQuery;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @version 1.0.0
 * @Title: XmglProjectMapper.java
 * @Description: TODO
 */
public interface XmglProjectMapper extends BaseMapper<XmglProject> {


	List<Map<String, Object>> getLeader();

	List<XmglProject> getList(String gsid);

	/**
	 * 获取项目管理列表
	 *
	 * @param xmglProject
	 * @param pageQuery
	 * @return
	 */
	List<XmglProject> getXmglList(@Param("xmglProject") XmglProject xmglProject, @Param("pageQuery") PageQuery pageQuery);


	Map getListSumTotal(@Param("xmglProject") XmglProject xmglProject);

	List<HashMap<String, Object>> getSelect(HashMap<String, Object> hashMap);

	/**
	 * 根据用户角色和部门获取项目里列表
	 *
	 * @param map
	 * @return
	 */
	List<HashMap<String, Object>> getProjectListByRoleAndDept(HashMap<String, Object> map);

	/**
	 * 根据项目类型获取项目编号
	 *
	 * @param projectCategory
	 * @return
	 */
	String getProjectCodeByProjectCategory(Integer projectCategory);

	/**
	 * 禅道项目表数据插入
	 *
	 * @param ztProject
	 * @return
	 */
	@DataSource("slave")
	int insertZT(ZTProject ztProject);

	/**
	 * 禅道项目表数据修改
	 *
	 * @param ztProject
	 * @return
	 */
	@DataSource("slave")
	int updateZT(ZTProject ztProject);

	/**
	 * 批量删除禅道数据库项目表
	 *
	 * @param codeList
	 * @return
	 */
	@DataSource("slave")
	int deleteBatchIds(List<String> codeList);

	/**
	 * 批量删除
	 *
	 * @param ids
	 * @return
	 */
	int removeByIds(List<Integer> ids);

	/**
	 * 禅道项目表插入
	 *
	 * @param ztProduct
	 * @return
	 */
	@DataSource("slave")
	int insertZTProduct(ZTProduct ztProduct);

	@DataSource("slave")
	int updateZTProduct(ZTProduct ztProduct);

	/**
	 * 插入项目进度中间表
	 *
	 * @param ztProjectproduct
	 * @return
	 */
	@DataSource("slave")
	int insertZTProjectproduct(ZTProjectproduct ztProjectproduct);


	@DataSource("slave")
	Integer getBugList(Map<String, Object> map);

}
